﻿using System;
using System.Collections;

namespace SharpTrainer.Util
{
    public class CollectionUtil
    {
        public static void PrintArrayList(ArrayList lst)
        {
            for (int i = 0; i < lst.Count; i++)
                Console.Write("{0} ", lst[i].ToString());

            Console.WriteLine();
            Console.WriteLine("******************************************");
        }

        public static void ListAll(IList lst)
        {
            var enumerator = lst.GetEnumerator();
            while (enumerator.MoveNext()) {
                Console.Write("{0} ", enumerator.Current.ToString());
            }

            Console.WriteLine();
            Console.WriteLine("******************************************");
        }

        public static void PringHashTable(Hashtable tbl)
        {
            foreach (string key in tbl.Keys)
                Console.WriteLine("{0} : {1}", key, tbl[key]);
        }
    }
}
